//寻找某一个字符在一个字符串中首次出现的位置,并返回这个字符对应的指针
#include <stdio.h>
#define SIZE 30
//function
char* searcht(char* pt1, char pt2);
void getword(char* num);
//*********
int main(void)
{
	char pt[SIZE];
	char qt;
	getword(pt);
	printf("enter:\n");
	scanf_s("%c", &qt, 1);
	if (searcht(pt, qt) != NULL)
		printf("%p", searcht(pt, qt));
	return 0;
}

char* searcht(char* pt1, char pt2)
{
	char ch;
	while ((ch = *pt1) != EOF)
	{
		if ((*pt1) != EOF && (*pt1 = pt2))
			return pt1;
		pt1++;
	}
	return NULL;
}
void getword(char* num)
{
	int count = 0;
	char ch;
	while ((ch = getchar()) != EOF && count <= 29)
	{
		*num++ = ch;
	}
}